package xie;

import org.junit.Test;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @Author: xieZW
 * @Date: 2022/11/18 16:31
 */
public class MianShi {

    @Test
    public void fun01() {


        long start = System.currentTimeMillis();
        List<Object> list = new ArrayList<>(16000);
        for (int i = 0; i < 10000; i++) {
            list.add(i);
        }
        for (int i = 0; i < 500; i++) {
            list.get(i);
        }
        long ArrayList = System.currentTimeMillis();
        long start1 = ArrayList - start;
        System.out.println("start1 = " + start1);

        List<Object> objects22 = new LinkedList<>();
        for (int i = 0; i < 10000; i++) {
            objects22.add(i);
        }
        for (int i = 0; i < 500; i++) {
            objects22.get(i);
        }
        long LinkedList = System.currentTimeMillis();
        long end = LinkedList - ArrayList;
        System.out.println("end = " + end);
    }
}
